The invention relates to video encoding and decoding, and more particularly, to methods and electronic devices for quantization and de-quantization.
A video sequence comprising a series of static frames requires considerable storage capacity and transmission bandwidth. A 90-min full color video stream, for example, having 640×480 pixels/frame and 15 frames/second, requires bandwidth of 640×480 (pixels/frame)×3(bytes/pixel)×15(frames/sec)=13.18 (MB/sec) and has a file size of 13.18 (MB/sec)×90×60=69.50 (GB). Such a sizeable digital video stream is difficult to be stored and transmitted in real time. Thus, many encoding techniques have been introduced to reduce the required memory size and transmission bandwidth.
Video encoders compliant with H.26x standards create standardized files that can be opened and played on any system with a standard-compliant decoder. Spatial and temporal redundancies of digital video can be encoded without significant visual quality degradation. H.264 coding is a generic standard, intended to be independent of a specific application, involving encoding based on statistical redundancies in temporal and spatial directions. Spatial redundancy is based on the similarity between adjacent pixels.
H.26x achieves encoding by quantizing the coefficients produced by applying DCT to 4×4 or 8×8 blocks of pixels in a picture and through motion compensation. Quantization comprises division of the DCT coefficient by a quantization scale related to quality level, with higher indices for better encoding efficiency but lower quality, and lower indices for the reverse. Conversely, H.26x achieves decoding by de-quantizing the quantized coefficients. De-quantization comprises multiplying the quantized value by a de-quantization scale related to quality level.